import request from "@/network/request";


export function getProblemList(keyword, page) {
    return request({
        url: '/problem/list',
        params: {
            keyword,
            page
        }
    });
}

export function getProblemDetail(problemId) {
    return request({
        url: '/problem/getById',
        params: {
            problemId,
            contestId: -1
        }
    });
}

export function getProblemSummary(problemId, language, page) {
    return request({
        url: '/problem/summary',
        params: {
            problemId,
            page,
            language
        }
    });
}

export function createAndUpdateProblem(problemModel) {
    return request({
        url: '/problem/createAndUpdate',
        data: problemModel
    });
}

export function getProblemListByCategory(category) {
    return request({
        url: '/problem/getListByCategory',
        params: {
            category
        }
    });
}